package com.java.demo;

import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

@Component
public class Articles {

    @Bean(value = {"art4","art5"})     //将当前方法的返回值存储到IoC容器中
    public ArticleInfo articleInfo() {
        ArticleInfo articleInfo = new ArticleInfo();
        articleInfo.setId("1");
        articleInfo.setContent("斗破苍穹");
        return articleInfo;
    }
}
